#ifndef VMC_LANE_FULL_MATCHING_DEFINES
#define VMC_LANE_FULL_MATCHING_DEFINES

#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Core>

class envelope2D
{
public:
    envelope2D();
    envelope2D(double minx, double miny, double maxx, double maxy);
    bool IsInRect(double x, double y) const;
    bool GetRange(Eigen::Vector2d &min, Eigen::Vector2d &max) const;
    bool ExpandBy(double x, double y);
    bool ExpandBy(double radius);
    double Width() const;
    double Height() const;
    double GetArea() const;
    double GetMinx() const;
    double GetMiny() const;
    Eigen::Vector2d GetCenter() const;
    static envelope2D GetEnvelope(const std::vector<Eigen::Vector3f> &geometry);
    static envelope2D GetEnvelope(const std::vector<Eigen::Vector3d> &geometry);
    static envelope2D GetEnvelope(const std::vector<Eigen::Vector2d> &geometry);
    static envelope2D Intersection(const envelope2D& r1, const envelope2D& r2);
    static envelope2D Union(const envelope2D& r1, const envelope2D& r2);
    static double IOU(const envelope2D& r1, const envelope2D& r2);
    static double CenterDiff(const envelope2D& r1, const envelope2D& r2);

private:
    double minx_;
    double miny_;
    double maxx_;
    double maxy_;
};

struct match_pair
{
    match_pair(unsigned int lhs, unsigned int rhs) : source(lhs), target(rhs)
    {
    }
    unsigned int source;
    unsigned int target;
};

struct accordance_pair
{
    Eigen::Vector3d source;
    Eigen::Vector3d target;
};

#endif